package com.zhouchb.blog.service.impl;

import com.zhouchb.blog.bean.BlogsTags;
import com.zhouchb.blog.dao.BlogTagsRepository;
import com.zhouchb.blog.service.BlogTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Zhouchb
 * @Create 2021-09-2021/9/8 :16:35
 * @Description
 */
@Service
public class BlogTagServiceImpl implements BlogTagService {
    @Autowired
    private BlogTagsRepository blogTagsRepository;
    @Transactional
    @Override
    public int saveService(BlogsTags blogsTags) {
        return blogTagsRepository.saveDao(blogsTags);
    }
@Transactional
    @Override
    public int saveListService(List<BlogsTags> blogsTags) {
        return blogTagsRepository.saveListDao(blogsTags);
    }

    @Override
    public List<BlogsTags> getByTagService(Long tagId) {
        return blogTagsRepository.getByTagDao(tagId);
    }

    @Override
    public List<BlogsTags> getByBlogService(Long blogId) {
        return blogTagsRepository.getByBlogDao(blogId);
    }

    @Override
    public int delListByBlog(Long blogId) {
        return blogTagsRepository.delListByBlog(blogId);
    }


}
